﻿using System;
using System.Collections.Generic;

namespace Bricks.Validation
{

    /// <summary>
    /// 
    /// </summary>
    /// <typeparam name="TTarget"></typeparam>
    /// <typeparam name="TValidator"></typeparam>
    public abstract class ValidatorFacadeBase<TTarget, TValidator> : FacadeBase<TValidator>, IValidatorFacade<TTarget, TValidator>
    {

        /// <summary>
        /// 
        /// </summary>
        /// <param name="validatorAccessor"></param>
        protected ValidatorFacadeBase(Func<TValidator> validatorAccessor) :
            base(validatorAccessor)
        { }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="target"></param>
        /// <returns></returns>
        public abstract IEnumerable<ValidationResult> Validate(TTarget target);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="target"></param>
        /// <returns></returns>
        public abstract IEnumerable<ValidationResult> Validate(object target);
    }
}
